{% extends "base.html" %} 


{% block extra_header %}
<script type="text/javascript" src="/static/js/extjs_extension/RemoteValidTextField.js"></script>
<script type="text/javascript" src="/static/js/extjs_extension/fixErrorMsgBox.js"></script>
<script type="text/javascript" src="/static/js/extjs_extension/passwordConfirmation.js"></script>
<script type="text/javascript" src="/static/js/GH/GH_UI/forms/GH.ui.forms.RegistrationForm.js"></script>
<script type="text/javascript" src="/static/js/GH/GH_UI/forms/GH.ui.forms.LoginForm.js"></script>
{% endblock %}

{% block title %} Log in  {% endblock %}

{% block extra_script %}
<script type="text/javascript">
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';

Ext.onReady(function () {
	var win = new Ext.Window({
	   title: "General Hospital Login",
	   layout: 'fit',
	   
	   width: 278,
	   height: 155,
	   
	   headerCfg: {
	        tag: 'center',
	        cls: 'x-window-header',  // Default class not applied if Custom element specified
	   },
	   
       
       closable : false,
       
       tbar:[ 
    	     { 
	             text: 'Register',
	             id : 'registration_button',
	             iconCls: 'icon-user_add',
	             handler: function(btn) {
	            	 var regWindow = new Ext.Window({
	            		 	   title: 'Registration Form',
	            		 	   closable: false,
	            		 	   layout: 'fit',
	            		 	   modal: true,
	            		 	   width : 400,
	            		 	   height: 280,
	            		 	   
	            		       items: [
									new GH.ui.forms.RegistrationForm()
	            	           ],
	            	             });
	            	 regWindow.setPosition(0,0);
	            	 regWindow.show();
	             }
       	   	  },
       	   	  '-'
     	   ],
       
       items : 
          new GH.ui.forms.LoginForm({
        	  handler: {
        		  post_success: function(redirectUrl) {
        			  window.location = redirectUrl;
        		  },
          
          		  post_failure: function() {
				  }
        	  }
          }),      
    });
	
	win.show();
})
</script>
{% endblock %}

{% block body %}
<!--<h1>Hello World eQuill!</h1>-->
<div id="hidden-csrf" class="x-hidden">
{% csrf_token %}
</div>
{% endblock %}